<script setup lang="ts">
import {ref} from 'vue'

// 2.在子组件创建数据
const car = ref('我是子组件中的车')
const logCar = () => {
    console.log(car.value);
    
}

//3. 主动暴露属性和方法，让父组件接收
defineExpose({car,logCar})
</script>

<template>
  <div class="button">
    子组件
 </div>
</template>

<style lang="css" scoped>
.button{
    width: 300px;
    height: 200px;
    background-color: greenyellow;
}
</style>
